package cmd

import (
	"gitee.com/crack007/goose"
	"gitee.com/crack007/goose/core/web"
	"github.com/crack007/go-im/src/module/api/handle"
)

func NewApiCommand() *goose.ModuleBuilder {
	apiHandle := handle.NewApiHandle()
	builder := web.NewHttpServerBuilder(apiHandle)
	builder.EnableDebugFlag().EnableConfigFlag().EnablePprof()
	builder.EnablePortFlag(80)
	builder.SetServerName("apiServer")
	moduleBuilder := goose.NewModuleBuilder(builder)
	return moduleBuilder.SetName("api").SetDesc("api 接口模块")
}
